<!DOCTYPE html>
<html lang="">
<head>
    <meta charset="UTF-8">
    <!-- 导入css -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <title>猫咪用品</title>
    <style>
        body {
            background-color: rgba(255, 170, 0, 0.27);
            margin: 0;
            padding: 0;
        }

        .el-header, .el-footer {
            margin: 0;
            padding: 0;
        }

        .el-header > div > div > a {
            text-decoration: none;
            color: #815343;
        }

        .el-menu.el-menu--horizontal {
            border: none;
        }
    </style>
</head>
<body>
<div id="app">
    <el-container>
        <el-header height="150px">
            <div style="background-color: white">
                <div style="width: 1200px;margin: 0 auto;">
                    <img src="imgs/logo.jpg" alt="" height="75px" width="150px" style="vertical-align: middle">
                    <a href="">首页</a>
                    <el-divider direction="vertical"></el-divider>
                    <a href="">养猫守则</a>
                    <el-divider direction="vertical"></el-divider>
                    <a href="">个人中心</a>
                    <el-divider direction="vertical"></el-divider>
                    <a href="">购物车</a>
                    <el-divider direction="vertical"></el-divider>
                    <a href="">帮助</a>
                </div>
            </div>
            <div style="background-color: #815343">
                <el-menu style="width: 1200px;margin: 0 auto;" mode="horizontal" background-color="#815343"
                         text-color="#fff" active-text-color="pink " @select="mainSelect" default-active="1">
                    <el-menu-item index="1">推荐产品</el-menu-item>
                    <el-menu-item index="2">粮食专区</el-menu-item>
                    <el-menu-item index="3">医疗保健</el-menu-item>
                    <el-menu-item index="4">生活品质</el-menu-item>
                    <el-menu-item index="5">清洁卫生</el-menu-item>
                    <div style="float: right;position: relative;top: 10px">
                        <el-input type="text" placeholder="请输入搜索内容" v-model="search">
                            <el-button slot="append" icon="el-icon-search"></el-button>
                        </el-input>
                    </div>
                </el-menu>
            </div>
        </el-header>
        <el-main>
            <!--推荐商品-->
            <div>
                <el-row gutter="20" style="width: 1200px;margin: 0 auto">
                    <el-col span="18">
                        <!--走马灯开始-->
                        <el-carousel trigger="click" height="380px">
                            <el-carousel-item v-for="item in 4">
                                <img :src="'imgs/b'+item+'.png'" width="100%" alt="">
                            </el-carousel-item>
                        </el-carousel>
                        <!--走马灯结束-->
                    </el-col>
                    <el-col span="6">
                        <!--销量榜-->
                        <el-card style="height: 380px;">
                            <i class="el-icon-trophy" style="font-weight: bold ;color:#eebc00;"> <span
                                    style="color:#000;">  销量最高</span></i>
                            <el-divider></el-divider>
                            <el-table :data="topArr">
                                <el-table-column type="index" label="编号"></el-table-column>
                                <el-table-column prop="title" label="商品品牌"></el-table-column>
                                <el-table-column prop="saleCount" label="销量"></el-table-column>
                            </el-table>
                        </el-card>
                        <!--销量榜-->
                    </el-col>
                </el-row>
                <el-container>
                    <el-header height="100px">
                        <div style="margin: 50px">
                            <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal"
                                     @select="recommendSelect" style="width: 1200px;margin: 0 auto;border-bottom: none"
                                     active-text-color="pink">
                                <div style="float: left;position: relative;top: 20px;left:10px;margin-right: 50px">
                                    <b style="color: #815343;margin: 0;padding: 0;" style="float: right">推荐商品</b>
                                </div>
                                <el-menu-item index="1"><b>幼猫</b></el-menu-item>
                                <el-menu-item index="2"><b>成猫</b></el-menu-item>
                                <el-menu-item index="3"><b>老猫</b></el-menu-item>
                            </el-menu>
                        </div>
                    </el-header>
                    <el-main>
                        <el-row gutter="20" style="width: 1200px;margin: 0 auto" v-if="currentIndex=='1'">
                            <el-col span="6" v-for="p in kittenArr">
                                <el-card>
                                    <img :src="p.url" width="100%" height="233px">
                                    <p style="font-size: 14px; height: 30px;">{{p.title}}</p>
                                    <p><b>￥{{p.price}}</b>
                                        <span style="float: right;">销量:{{p.saleCount}}</span>
                                    </p>
                                </el-card>
                            </el-col>
                        </el-row>
                        <el-row gutter="20" style="width: 1200px;margin: 0 auto" v-if="currentIndex=='2'">
                            <el-col span="6" v-for="p in adultArr">
                                <el-card>
                                    <img :src="p.url" width="100%" height="233px">
                                    <p style="font-size: 14px; height: 30px;">{{p.title}}</p>
                                    <p><b>￥{{p.price}}</b>
                                        <span style="float: right;">销量:{{p.saleCount}}</span>
                                    </p>
                                </el-card>
                            </el-col>
                        </el-row>
                        <el-row gutter="20" style="width: 1200px;margin: 0 auto" v-if="currentIndex=='3'">
                            <el-col span="6" v-for="p in oldArr">
                                <el-card>
                                    <img :src="p.url" width="100%" height="233px">
                                    <p style="font-size: 14px; height: 30px;">{{p.title}}</p>
                                    <p><b>￥{{p.price}}</b>
                                        <span style="float: right;">销量:{{p.saleCount}}</span>
                                    </p>
                                </el-card>
                            </el-col>
                        </el-row>
                    </el-main>
                </el-container>
            </div>
            <!--粮食专区-->
        </el-main>
        <el-footer>
            <div style="background-color: #282c30; color:#666;text-align: center;padding: 50px 0;width: 100%;">
                <p>Copyright © 北京达内金桥科技有限公司版权所有 京ICP备12003709号-3 京公网安备 11010802029572号</p>
                <p>达内在线WWW.TMOOC.CN 专注于IT职业技能培训</p>
                <p>涵盖20余门课程体系，致力于打造权威的IT职业教育学习平台</p>
            </div>
        </el-footer>
    </el-container>
</div>
</body>

<!-- 在element组件前导入vue -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- 导入js -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
    let v = new Vue({
        el: '#app',
        data: function () {
            return {
                /*确认推荐显示类型*/
                currentIndex: "1",
                /*与搜索框绑定*/
                search: "",
                /*轮播图旁销量榜*/
            }
        },
        methods: {
            /*显示设置  推荐商品*/
            recommendSelect(key, keyPath) {
                v.currentIndex = key;
            },
            /*显示专区*/
            mainSelect(key) {

            }
        }
    })
</script>
</html>